package com.web;

import com.pojo.CePing_x;
import com.service.CePingService_x;
import com.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ceping")
public class CePingController_x {
    @Autowired
    private CePingService_x cePingServiceX;
    @RequestMapping("/select")
    Result listAll(){
        return Result.ok(cePingServiceX.listAll());
    }
    @RequestMapping("/select2")
    Result listAll2(){
        return Result.ok(cePingServiceX.listAll2());
    }
    @RequestMapping("/add")
    public Result add(CePing_x cePingX){
        return Result.ok(cePingServiceX.add(cePingX));
    }
    @RequestMapping("/update")
    Result update(CePing_x cePingX){
        return Result.ok(cePingServiceX.update(cePingX));
    }
    @RequestMapping("/delete")
    Result delete(Integer id){
        return Result.ok(cePingServiceX.delete(id));
    }
    @RequestMapping("selectAll")
    public List<CePing_x> select(Integer id, String title) {
        return cePingServiceX.select(id, title);
    }
}
